<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欢迎您登录微分销管理系统后台</title>
    <link href="__INSPINIA__/css/bootstrap.min.css" rel="stylesheet">
    <link href="__INSPINIA__/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="__INSPINIA__/css/animate.css" rel="stylesheet">
    <link href="__INSPINIA__/css/style.css" rel="stylesheet">
	<!-- Toastr style -->
	<link href="__INSPINIA__/css/plugins/toastr/toastr.min.css" rel="stylesheet">
</head>
<body class="white-bg">
    <div class="middle-box text-center loginscreen animated fadeInDown">
        <div>
            <div>
                <h1 class="logo-name">管</h1>
            </div>
            <h3>欢迎使用微分销管理后台</h3>
            <form action="{:U('login')}" method="post" >
                <div class="form-group">
                    <input required="" type="text" id="username" name="username" class="form-control" placeholder="请填写用户名" >
                </div>
                <div class="form-group">
                    <input required="" type="password" id="password" name="password"  class="form-control" placeholder="请填写密码">
                </div>
                <div class="form-group">
                    <input  required="" type="text" id="verify" name="verify" class="form-control" placeholder="请填写验证码" autocomplete="off">
                </div> 
                <div class="form-group">
                    <img class="verifyimg reloadverify full-width" alt="点击切换" src="{:U('Public/verify')}" style="cursor:pointer;">
                </div> 
                <button type="submit" class="btn btn-primary block full-width m-b">登陆</button>
                

				<div class="space-4"></div>
			</form>

                <!-- <a href="#"><small>忘记密码？</small></a>
                <p class="text-muted text-center"><small>还没有账号?</small></p>
                <a class="btn btn-sm btn-white btn-block" href="{:U('User/register')}">立即注册</a> -->
            <p class="m-t"> <small><strong>版权所有</strong> 西安微开网络科技有限公司 &copy;2015</small> </p>
        </div>
    </div>
    <!-- Mainly scripts -->
    <script src="__INSPINIA__/js/jquery-2.1.1.js"></script>
    <script src="__INSPINIA__/js/bootstrap.min.js"></script>
    <!-- Toastr -->
    <script src="__INSPINIA__/js/plugins/toastr/toastr.min.js"></script>
	<script type="text/javascript">
    	$(document)
	    	.ajaxStart(function(){
	    		$("button:submit").addClass("log-in").attr("disabled", true);
	    	})
	    	.ajaxStop(function(){
	    		$("button:submit").removeClass("log-in").attr("disabled", false);
	    	});
    	$("form").submit(function(){
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;

    		function success(data){
    			if(data.status){
    				window.location.href = data.url;
    			} else {
   		           setTimeout(function() {
   		               toastr.options = {
   		                   closeButton: true,
   		                   progressBar: true,
   		                   showMethod: 'slideDown',
   		                   timeOut: 1000
   		               };
   		               toastr.error(data.info, '出错了');
   		           }, 1300);
    				//刷新验证码
    				$(".reloadverify").click();
    			}
    		}
    	});

		$(function(){
			var verifyimg = $(".verifyimg").attr("src");
            $(".reloadverify").click(function(){
                if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/\?.*$/,'')+'?'+Math.random());
                }
            });
		});
	</script>
</body>

</html>
 